<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>doh.robot Button Test</title>

		<style>
			@import "../../../../util/doh/robot/robot.css";
		</style>

		<!-- required: dojo.js -->
		<script type="text/javascript" src="../../../../dojo/dojo.js"
			djConfig="isDebug: true, parseOnLoad: true"></script>

		<script type="text/javascript" src="../../helpers.js"></script>

		<script type="text/javascript">
			dojo.require("dijit.robotx");

			dojo.addOnLoad(function(){
				doh.robot.initRobot('../FormInvalid.html');

				doh.register("dijit.form.Form", [
					{
						name: "initial",
						timeout: 15000,
						runTest: function(){
							// Submit button is initially disabled
							doh.t(dijit.byId("submitBtn").get("disabled"));
						}
					},
					{
						name: "filling in first field doesn't change disabled state",
						timeout: 15000,
						runTest: function(){
							var d = new doh.Deferred();

							doh.robot.sequence(function(){
								dijit.byId("field1").focus();
							});
							doh.robot.typeKeys("hello", 500, 500);

							doh.robot.sequence(d.getTestCallback(function(){
								doh.t(dijit.byId("submitBtn").get("disabled"));
							}), 500);
							return d;
						}
					},
					{
						name: "filling in second field enables form",
						timeout: 15000,
						runTest: function(){
							var d = new doh.Deferred();

							doh.robot.sequence(function(){
								dijit.byId("field2").focus();
							}, 500);
							doh.robot.typeKeys("world", 500, 500);

							doh.robot.sequence(d.getTestCallback(function(){
								doh.f(dijit.byId("submitBtn").get("disabled"));
							}), 500);
							return d;
						}
					}
				]);

				doh.run();
			});
		</script>
	</head>
</html>
